Skip to content

refactor: rename or combinator to chain#14

Merged
tisonkun merged 3 commits intomainfrom
or-to-chain
Dec 8, 2025
Merged

refactor: rename or combinator to chain#14
tisonkun merged 3 commits intomainfrom
or-to-chain

Conversation

@tisonkun
Copy link
Copy Markdown
Contributor

@tisonkun tisonkun commented Dec 8, 2025

No description provided.

Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the combinator API by renaming the or combinator to chain, which better reflects its sequential execution semantics. The or name was potentially confusing as it suggests a logical OR operation, whereas chain more clearly indicates that visitors are executed one after another.

Key changes:

  • Renamed VisitorExt::or() and VisitorMutExt::or() methods to chain()
  • Renamed OrVisitor struct to ChainVisitor
  • Updated documentation and test usages to reflect the new naming

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
traversable/src/combinator.rs Renamed combinator methods from or to chain, renamed struct from OrVisitor to ChainVisitor, and updated documentation
traversable/tests/test_combinator.rs Updated test code to use the new chain() method instead of or()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread traversable/src/combinator.rs Outdated
/// This struct is created by the [`or`](VisitorExt::or) method on [`VisitorExt`] or
/// [`VisitorMutExt`].
pub struct OrVisitor<V1, V2> {
/// This struct is created by the `chain` method on [`VisitorExt`] or [`VisitorMutExt`].
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation should use a proper doc link for the chain method like [chain](VisitorExt::chain) or [chain] to maintain consistency with the original documentation style and enable proper cross-referencing in generated documentation.

Suggested change
/// This struct is created by the `chain` method on [`VisitorExt`] or [`VisitorMutExt`].
/// This struct is created by the [`chain`](VisitorExt::chain) method on [`VisitorExt`] or [`VisitorMutExt`].

Copilot uses AI. Check for mistakes.
Signed-off-by: tison <wander4096@gmail.com>
@tisonkun tisonkun enabled auto-merge (squash) December 8, 2025 06:55
@tisonkun tisonkun merged commit e74b2d4 into main Dec 8, 2025
9 checks passed
@tisonkun tisonkun deleted the or-to-chain branch December 8, 2025 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants